<?php
/**
 * Created by PhpStorm.
 * User: qixiuxiu
 * Date: 2017/4/6
 * Time: 11:32
 */
namespace Calendar\Controller;

use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response;
use Calendar\Model\LeapYear;
class LeapYearController
{
    //需要Request对象年份作为参数
    public function indexAction($year)
    {
        $leapyear = new LeapYear();
        if ($leapyear->isleapyear($year)==1) {
            return new Response('Yep, this is a leap year!');
        }else{
            return new Response('Nope, this is not a leap year.');
        }
    }
}